<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<form action="login" method="post">
    <input type="text" name="usr" id="usr"/>
    <input type="password" name="pwd" id="pwd"/>
    <input type="submit" name="登录" id="dl"/>
</form>
<script>
    var cookie=document.cookie;
    var  cks=cookie.split(";");
    var  usr=document.getElementById("usr");
    var pwd=document.getElementById("pwd");
    for (var i=0;i<cks.length;i++) {
        var kv = cks[i].split("=");
        if(kv[0].trim()=="usr") usr.value=kv[1];
        if(kv[0].trim()=="password") {
            pwd.value = kv[1];
        }
    }
if (usr.value!=""&&pwd.value!=""){
        document.getElementById("dl").click();
}
</script>
</body>
</html>